package com.dao;

import java.util.List;

import com.beans.MemberInfo;
import com.beans.PageInfo;
import com.jdbc.DBUtil;

public class MemberDao {

	public List<MemberInfo> getMemberList(String sql,PageInfo page) {
		return DBUtil.getList(sql, MemberInfo.class,page.getBeginRow(),page.getPageSize());
	}

	public int number(String sql) {
		return Integer.parseInt(DBUtil.getScalar(sql)+"");
	}

	public void delete(int id) {
		DBUtil.update("delete from memberinfo where id=?",id);
	}

	public MemberInfo getMemberinfoByid(int id) {
		return DBUtil.getSingleObj("select * from memberinfo where id=?", MemberInfo.class, id);
	}


}
